﻿@model IEnumerable<HdipCricketClub.Models.OpponentFixturePlayer>

@{
    ViewBag.Title = "Input the name of opposing teams' players";
}

<h2>@ViewBag.Title</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("InputPlayers", "Scorecard", FormMethod.Post))
{
@Html.ValidationSummary(false)   
<table>
    <tr>
        <th>
            Player No:
        </th>
        <th>
            Name:
        </th>
     </tr>

@{var i = 0;}
@foreach (var item in Model)
{
    <tr>
            @Html.HiddenFor(modelItem => item.op_fixture_id)
            @Html.HiddenFor(modelItem => item.op_player_no)
        <td>
            @(i + 1)
        </td>
        <td>
            @Html.EditorFor(modelItem => item.op_player_name)
            @Html.ValidationMessageFor(modelItem => item.op_player_name)
        </td>
    </tr>
    i++;
}

</table>

<p>
<input type="submit" value="Save" />
</p>
}
